import type { RarityLevel } from "./types";

import { rarityColor } from "./main";

export function rarityBadge(level: RarityLevel) {
  return (
    `<g transform="translate(10 312)">` +
    box(level) +
    diamond(level) +
    loot(level) +
    description(level) +
    `</g>`
  );
}

function boxWidth(level: RarityLevel): number {
  if (level === 2) return 123;
  if (level === 3) return 83;
  if (level === 4) return 81;
  if (level === 5) return 118;
  if (level === 6) return 96;
  return 108;
}

function box(level: RarityLevel) {
  const color = rarityColor(level);
  const width = boxWidth(level) - 1;
  return (
    `<rect x="0.5" y="0.5" width="${width}" height="27" fill="${color}" fill-opacity="0.13"/>` +
    `<rect x="0.5" y="0.5" width="${width}" height="27" stroke="${color}"/>`
  );
}

function loot(level: RarityLevel) {
  const color = rarityColor(level);
  const xshift = [75, 90, 50, 48, 85, 63][level - 1] - 75;
  return (
    `<g transform="translate(${xshift} 0)">` +
    `<path d="${LOOT_PATH}" fill="${color}"/>` +
    `</g>`
  );
}

function description(level: RarityLevel) {
  if (level === 2) return DESC_2;
  if (level === 3) return DESC_3;
  if (level === 4) return DESC_4;
  if (level === 5) return DESC_5;
  if (level === 6) return DESC_6;
  return DESC_1;
}

function diamond(level: RarityLevel) {
  return `<path d="${DIAMOND_PATH}" fill="${rarityColor(level)}"/>`;
}

const DESC_1 =
  '<path d="M24.464 18.62c-.832 0-1.528-.184-2.088-.552-.56-.368-.984-.88-1.272-1.536-.288-.664-.432-1.44-.432-2.328 0-.864.148-1.624.444-2.28.304-.664.744-1.18 1.32-1.548.584-.376 1.308-.564 2.172-.564.848 0 1.476.132 1.884.396.416.256.624.576.624.96a.797.797 0 0 1-.324.66c-.216.16-.496.24-.84.24 0-.256-.044-.504-.132-.744a1.35 1.35 0 0 0-.432-.6c-.2-.16-.472-.24-.816-.24-.872 0-1.488.324-1.848.972-.352.64-.528 1.556-.528 2.748 0 .728.084 1.36.252 1.896.168.536.432.952.792 1.248.368.288.848.432 1.44.432.576 0 1.032-.108 1.368-.324a3.17 3.17 0 0 0 .816-.732c.144.104.216.264.216.48 0 .208-.092.424-.276.648-.176.216-.456.4-.84.552-.384.144-.884.216-1.5.216Zm6.587 0c-.888 0-1.588-.276-2.1-.828-.512-.552-.768-1.392-.768-2.52 0-1.128.244-1.964.732-2.508.488-.552 1.212-.828 2.172-.828.888 0 1.588.276 2.1.828.512.544.768 1.38.768 2.508 0 1.128-.248 1.968-.744 2.52-.488.552-1.208.828-2.16.828Zm.024-.66c.56 0 .952-.228 1.176-.684.232-.456.348-1.124.348-2.004 0-.888-.116-1.552-.348-1.992-.232-.448-.628-.672-1.188-.672-.56 0-.956.224-1.188.672-.224.44-.336 1.104-.336 1.992 0 .88.116 1.548.348 2.004.232.456.628.684 1.188.684Zm3.827.54v-.54h.12c.272 0 .492-.048.66-.144.176-.104.264-.34.264-.708V13.4c0-.344-.088-.564-.264-.66-.168-.096-.384-.144-.648-.144h-.036v-.528h2.064l.156.936h.06c.24-.448.508-.736.804-.864a2.47 2.47 0 0 1 1.02-.204c.392 0 .744.084 1.056.252.32.16.552.432.696.816h.108c.24-.448.52-.736.84-.864.32-.136.668-.204 1.044-.204.616 0 1.096.188 1.44.564.352.368.528.96.528 1.776v2.82c0 .376.08.616.24.72.16.096.376.144.648.144h.036v.54h-2.244v-4.092c0-.52-.088-.92-.264-1.2-.176-.288-.48-.432-.912-.432-.312 0-.56.084-.744.252-.184.16-.316.376-.396.648-.08.264-.12.552-.12.864v2.556c0 .376.08.616.24.72.168.096.384.144.648.144h.036v.54h-2.244v-4.092c0-.52-.088-.92-.264-1.2-.176-.288-.48-.432-.912-.432-.328 0-.588.092-.78.276a1.493 1.493 0 0 0-.396.708c-.08.288-.12.6-.12.936v2.472c0 .344.092.564.276.66.184.088.408.132.672.132h.036v.54h-3.348Zm11.472 0v-.54h.12c.273 0 .492-.048.66-.144.176-.104.264-.34.264-.708V13.4c0-.344-.087-.564-.264-.66-.168-.096-.384-.144-.648-.144h-.035v-.528h2.064l.156.936h.06c.24-.448.508-.736.803-.864a2.47 2.47 0 0 1 1.02-.204c.393 0 .745.084 1.056.252.32.16.552.432.697.816h.108c.24-.448.52-.736.84-.864.32-.136.668-.204 1.044-.204.615 0 1.095.188 1.44.564.352.368.527.96.527 1.776v2.82c0 .376.08.616.24.72.16.096.377.144.648.144h.037v.54h-2.244v-4.092c0-.52-.088-.92-.264-1.2-.177-.288-.48-.432-.913-.432-.312 0-.56.084-.743.252-.184.16-.316.376-.396.648-.08.264-.12.552-.12.864v2.556c0 .376.08.616.24.72.167.096.383.144.648.144h.036v.54H51.21v-4.092c0-.52-.088-.92-.264-1.2-.177-.288-.48-.432-.913-.432-.328 0-.587.092-.78.276a1.493 1.493 0 0 0-.395.708c-.08.288-.12.6-.12.936v2.472c0 .344.092.564.276.66.184.088.407.132.672.132h.035v.54h-3.348Zm14.665.12c-.888 0-1.588-.276-2.1-.828-.512-.552-.768-1.392-.768-2.52 0-1.128.244-1.964.732-2.508.488-.552 1.212-.828 2.172-.828.888 0 1.588.276 2.1.828.512.544.768 1.38.768 2.508 0 1.128-.248 1.968-.744 2.52-.488.552-1.208.828-2.16.828Zm.024-.66c.56 0 .952-.228 1.176-.684.232-.456.348-1.124.348-2.004 0-.888-.116-1.552-.348-1.992-.232-.448-.628-.672-1.188-.672-.56 0-.956.224-1.188.672-.224.44-.336 1.104-.336 1.992 0 .88.116 1.548.348 2.004.232.456.628.684 1.188.684Zm3.827.54v-.54h.072c.272 0 .5-.048.684-.144.192-.104.288-.34.288-.708v-3.696c0-.344-.092-.564-.276-.66a1.366 1.366 0 0 0-.66-.144h-.048v-.54h2.1l.156.936h.06c.248-.448.524-.736.828-.864a2.501 2.501 0 0 1 1.032-.204c.632 0 1.124.188 1.476.564.352.368.528.96.528 1.776v2.82c0 .376.076.616.228.72.16.096.376.144.648.144h.06v.54H69.81v-4.092c0-.52-.092-.92-.276-1.2-.176-.288-.488-.432-.936-.432-.336 0-.604.092-.804.276a1.524 1.524 0 0 0-.42.708c-.08.288-.12.6-.12.936v2.472c0 .344.088.564.264.66.184.088.408.132.672.132h.048v.54H64.89Z" fill="#838383"/>';

const DESC_2 =
  '<path d="M24.428 18.62c-.976 0-1.74-.208-2.292-.624-.544-.416-.816-1.116-.816-2.1v-4.632c0-.344-.088-.56-.264-.648a1.258 1.258 0 0 0-.612-.144h-.264v-.54h3.672v.54H23.6c-.24 0-.448.048-.624.144-.168.096-.252.328-.252.696v4.668c0 .688.18 1.176.54 1.464.36.28.828.42 1.404.42.648 0 1.132-.164 1.452-.492.32-.336.48-.788.48-1.356v-4.752c0-.344-.088-.56-.264-.648a1.215 1.215 0 0 0-.612-.144h-.252v-.54h3.048v.54h-.252c-.248 0-.46.048-.636.144-.168.096-.252.328-.252.696v4.728c0 .8-.248 1.432-.744 1.896-.496.456-1.232.684-2.208.684Zm4.58-.12v-.54h.071c.272 0 .5-.048.684-.144.192-.104.288-.34.288-.708v-3.696c0-.344-.092-.564-.276-.66a1.366 1.366 0 0 0-.66-.144h-.048v-.54h2.1l.156.936h.06c.248-.448.524-.736.828-.864a2.501 2.501 0 0 1 1.032-.204c.632 0 1.124.188 1.476.564.352.368.528.96.528 1.776v2.82c0 .376.076.616.228.72.16.096.376.144.648.144h.06v.54h-2.256v-4.092c0-.52-.092-.92-.276-1.2-.176-.288-.488-.432-.936-.432-.336 0-.604.092-.804.276a1.524 1.524 0 0 0-.42.708c-.08.288-.12.6-.12.936v2.472c0 .344.088.564.264.66.184.088.408.132.672.132h.048v.54h-3.348Zm10.936.12c-.544 0-1.028-.108-1.452-.324-.416-.224-.744-.576-.984-1.056-.24-.488-.36-1.128-.36-1.92 0-.864.12-1.54.36-2.028s.568-.836.984-1.044a3.096 3.096 0 0 1 1.404-.312c.384 0 .74.048 1.068.144.328.096.592.236.792.42.2.184.3.408.3.672 0 .272-.092.48-.276.624-.184.136-.492.204-.924.204 0-.384-.064-.716-.192-.996-.128-.288-.38-.432-.756-.432-.288 0-.54.08-.756.24-.208.16-.368.44-.48.84-.112.392-.168.944-.168 1.656 0 .84.132 1.468.396 1.884.264.408.7.612 1.308.612.384 0 .716-.08.996-.24.288-.168.5-.38.636-.636.152.112.228.276.228.492 0 .192-.08.38-.24.564-.152.184-.384.336-.696.456-.312.12-.708.18-1.188.18Zm6.095 0c-.888 0-1.588-.276-2.1-.828-.512-.552-.768-1.392-.768-2.52 0-1.128.244-1.964.732-2.508.488-.552 1.212-.828 2.172-.828.888 0 1.588.276 2.1.828.512.544.768 1.38.768 2.508 0 1.128-.248 1.968-.744 2.52-.488.552-1.208.828-2.16.828Zm.024-.66c.56 0 .952-.228 1.176-.684.232-.456.348-1.124.348-2.004 0-.888-.116-1.552-.348-1.992-.232-.448-.628-.672-1.188-.672-.56 0-.956.224-1.188.672-.224.44-.336 1.104-.336 1.992 0 .88.116 1.548.348 2.004.232.456.628.684 1.188.684Zm3.827.54v-.54h.12c.272 0 .492-.048.66-.144.176-.104.264-.34.264-.708V13.4c0-.344-.088-.564-.264-.66-.168-.096-.384-.144-.648-.144h-.036v-.528h2.064l.156.936h.06c.24-.448.508-.736.804-.864a2.47 2.47 0 0 1 1.02-.204c.392 0 .744.084 1.056.252.32.16.552.432.696.816h.108c.24-.448.52-.736.84-.864.32-.136.668-.204 1.044-.204.616 0 1.096.188 1.44.564.352.368.528.96.528 1.776v2.82c0 .376.08.616.24.72.16.096.376.144.648.144h.036v.54h-2.244v-4.092c0-.52-.088-.92-.264-1.2-.176-.288-.48-.432-.912-.432-.312 0-.56.084-.744.252-.184.16-.316.376-.396.648-.08.264-.12.552-.12.864v2.556c0 .376.08.616.24.72.168.096.384.144.648.144h.036v.54h-2.244v-4.092c0-.52-.088-.92-.264-1.2-.176-.288-.48-.432-.912-.432-.328 0-.588.092-.78.276a1.493 1.493 0 0 0-.396.708c-.08.288-.12.6-.12.936v2.472c0 .344.092.564.276.66.184.088.408.132.672.132h.036v.54H49.89Zm11.473 0v-.54h.12c.272 0 .492-.048.66-.144.176-.104.264-.34.264-.708V13.4c0-.344-.088-.564-.264-.66-.168-.096-.384-.144-.648-.144h-.036v-.528h2.064l.156.936h.06c.24-.448.508-.736.804-.864a2.47 2.47 0 0 1 1.02-.204c.392 0 .744.084 1.056.252.32.16.552.432.696.816h.108c.24-.448.52-.736.84-.864.32-.136.668-.204 1.044-.204.616 0 1.096.188 1.44.564.352.368.528.96.528 1.776v2.82c0 .376.08.616.24.72.16.096.376.144.648.144h.036v.54h-2.244v-4.092c0-.52-.088-.92-.264-1.2-.176-.288-.48-.432-.912-.432-.312 0-.56.084-.744.252-.184.16-.316.376-.396.648-.08.264-.12.552-.12.864v2.556c0 .376.08.616.24.72.168.096.384.144.648.144h.036v.54h-2.244v-4.092c0-.52-.088-.92-.264-1.2-.176-.288-.48-.432-.912-.432-.328 0-.588.092-.78.276a1.493 1.493 0 0 0-.396.708c-.08.288-.12.6-.12.936v2.472c0 .344.092.564.276.66.184.088.408.132.672.132h.036v.54h-3.348Zm14.664.12c-.888 0-1.588-.276-2.1-.828-.512-.552-.768-1.392-.768-2.52 0-1.128.244-1.964.732-2.508.488-.552 1.212-.828 2.172-.828.888 0 1.588.276 2.1.828.512.544.768 1.38.768 2.508 0 1.128-.248 1.968-.744 2.52-.488.552-1.208.828-2.16.828Zm.024-.66c.56 0 .952-.228 1.176-.684.232-.456.348-1.124.348-2.004 0-.888-.116-1.552-.348-1.992-.232-.448-.628-.672-1.188-.672-.56 0-.956.224-1.188.672-.224.44-.336 1.104-.336 1.992 0 .88.116 1.548.348 2.004.232.456.628.684 1.188.684Zm3.827.54v-.54h.072c.272 0 .5-.048.684-.144.192-.104.288-.34.288-.708v-3.696c0-.344-.092-.564-.276-.66a1.366 1.366 0 0 0-.66-.144h-.048v-.54h2.1l.156.936h.06c.248-.448.524-.736.828-.864a2.501 2.501 0 0 1 1.032-.204c.632 0 1.124.188 1.476.564.352.368.528.96.528 1.776v2.82c0 .376.076.616.228.72.16.096.376.144.648.144h.06v.54h-2.256v-4.092c0-.52-.092-.92-.276-1.2-.176-.288-.488-.432-.936-.432-.336 0-.604.092-.804.276a1.524 1.524 0 0 0-.42.708c-.08.288-.12.6-.12.936v2.472c0 .344.088.564.264.66.184.088.408.132.672.132h.048v.54h-3.348Z" fill="#00DC82"/>';

const DESC_3 =
  '<path d="M20.42 18.5v-.54h.252c.24 0 .448-.044.624-.132.176-.088.264-.304.264-.648v-5.916c0-.344-.088-.56-.264-.648a1.284 1.284 0 0 0-.624-.144h-.252v-.54h3.408c1.064 0 1.852.192 2.364.576.52.384.78.956.78 1.716 0 .424-.088.784-.264 1.08a2.203 2.203 0 0 1-.648.708 3.948 3.948 0 0 1-.816.42l1.584 2.556c.2.328.396.572.588.732.192.16.408.24.648.24h.048v.54h-.24c-.496 0-.888-.024-1.176-.072a1.549 1.549 0 0 1-.696-.312c-.184-.16-.364-.392-.54-.696l-1.56-2.688h-.948v2.448c0 .344.088.56.264.648.176.088.384.132.624.132h.252v.54H20.42Zm3.336-4.368c.656 0 1.108-.152 1.356-.456.248-.304.372-.764.372-1.38 0-.632-.136-1.08-.408-1.344-.264-.272-.712-.408-1.344-.408h-.78v3.588h.804Zm6.731 4.488c-.528 0-.972-.156-1.332-.468-.352-.32-.528-.808-.528-1.464 0-.64.224-1.112.672-1.416.448-.312 1.132-.484 2.052-.516l.984-.036v-.696c0-.288-.024-.54-.072-.756a.826.826 0 0 0-.276-.504c-.144-.128-.364-.192-.66-.192-.424 0-.7.124-.828.372s-.192.56-.192.936c-.384 0-.676-.056-.876-.168-.2-.12-.3-.32-.3-.6 0-.28.1-.504.3-.672.2-.176.468-.304.804-.384.344-.08.724-.12 1.14-.12.76 0 1.328.156 1.704.468.384.312.576.844.576 1.596v3.096c0 .336.056.564.168.684.112.12.304.18.576.18h.036v.54h-1.788l-.204-.972h-.108a7.615 7.615 0 0 1-.492.576 1.9 1.9 0 0 1-.552.384c-.208.088-.476.132-.804.132Zm.384-.78c.448 0 .804-.148 1.068-.444.264-.296.396-.692.396-1.188v-.948l-.708.036c-.616.024-1.044.16-1.284.408-.24.24-.36.588-.36 1.044 0 .728.296 1.092.888 1.092Zm4.395.66v-.54h.036c.272 0 .5-.048.684-.144.192-.104.288-.344.288-.72v-3.672c0-.352-.092-.576-.276-.672a1.438 1.438 0 0 0-.672-.144h-.036v-.54h2.004l.228 1.116h.06c.104-.24.216-.452.336-.636a1.31 1.31 0 0 1 .492-.444c.208-.112.484-.168.828-.168.448 0 .78.08.996.24.216.16.324.384.324.672 0 .28-.1.508-.3.684-.192.168-.5.252-.924.252 0-.328-.048-.568-.144-.72-.088-.16-.248-.24-.48-.24a.695.695 0 0 0-.552.252 1.78 1.78 0 0 0-.336.636c-.08.256-.14.52-.18.792a6.248 6.248 0 0 0-.048.72v1.932c0 .352.092.576.276.672.192.088.416.132.672.132h.348v.54h-3.624Zm8.98.12c-.912 0-1.62-.288-2.124-.864-.496-.576-.744-1.384-.744-2.424 0-1.128.236-1.976.708-2.544.48-.568 1.16-.852 2.04-.852.8 0 1.428.244 1.884.732.464.48.696 1.196.696 2.148v.564h-3.972c.016.856.168 1.48.456 1.872.296.384.72.576 1.272.576.416 0 .768-.088 1.056-.264.296-.176.516-.38.66-.612.064.032.12.088.168.168a.49.49 0 0 1 .084.288c0 .176-.08.36-.24.552-.152.184-.392.34-.72.468-.32.128-.728.192-1.224.192Zm1.08-3.924c0-.624-.092-1.124-.276-1.5-.184-.384-.496-.576-.936-.576-.416 0-.74.18-.972.54-.224.352-.352.864-.384 1.536h2.568Z" fill="#2E82FF"/>';

const DESC_4 =
  '<path d="M20.42 18.5v-.54h.252c.24 0 .448-.044.624-.132.176-.088.264-.304.264-.648v-5.868c0-.368-.088-.6-.264-.696a1.241 1.241 0 0 0-.624-.144h-.252v-.54h6.216l.06 2.124h-.684l-.06-.528a1.34 1.34 0 0 0-.264-.684c-.144-.184-.38-.276-.708-.276h-2.016v3.144h2.88v.624h-2.88v3.528h2.34c.336 0 .58-.092.732-.276.16-.192.26-.42.3-.684l.084-.528h.684L27.02 18.5h-6.6Zm7.354 2.88v-.54h.108c.16 0 .312-.02.456-.06.144-.04.26-.12.348-.24.096-.112.144-.292.144-.54v-6.564c0-.36-.092-.588-.276-.684a1.41 1.41 0 0 0-.66-.144h-.144v-.54h2.172l.144 1.044h.048c.184-.352.42-.632.708-.84.288-.216.664-.324 1.128-.324.8 0 1.408.268 1.824.804.424.528.636 1.372.636 2.532s-.212 2.008-.636 2.544c-.416.536-1.016.804-1.8.804-.464 0-.844-.096-1.14-.288a2.215 2.215 0 0 1-.696-.744h-.048c.016.216.028.46.036.732.016.272.024.488.024.648v1.068c0 .232.044.404.132.516a.647.647 0 0 0 .36.216c.144.04.296.06.456.06h.096v.54h-3.42Zm3.9-3.552c.496 0 .848-.216 1.056-.648.216-.432.324-1.068.324-1.908 0-.832-.108-1.46-.324-1.884-.208-.424-.56-.636-1.056-.636-.584 0-.984.212-1.2.636-.216.416-.324 1.048-.324 1.896 0 .832.108 1.464.324 1.896.216.432.616.648 1.2.648Zm5.34-6.924a.882.882 0 0 1-.563-.18c-.144-.12-.216-.32-.216-.6 0-.288.072-.488.216-.6.152-.12.34-.18.564-.18.208 0 .388.06.54.18.16.112.24.312.24.6 0 .28-.08.48-.24.6a.845.845 0 0 1-.54.18ZM35.3 18.5v-.54h.156c.16 0 .312-.016.456-.048a.652.652 0 0 0 .348-.228c.096-.112.144-.284.144-.516V13.4c0-.232-.048-.404-.144-.516a.592.592 0 0 0-.348-.216 1.696 1.696 0 0 0-.456-.06h-.06v-.54h2.328v5.052c0 .248.044.432.132.552a.716.716 0 0 0 .36.228c.144.04.296.06.456.06h.156v.54h-3.528Zm7.13.12c-.545 0-1.029-.108-1.453-.324-.416-.224-.744-.576-.984-1.056-.24-.488-.36-1.128-.36-1.92 0-.864.12-1.54.36-2.028s.568-.836.984-1.044a3.096 3.096 0 0 1 1.404-.312c.384 0 .74.048 1.068.144.328.096.592.236.792.42.2.184.3.408.3.672 0 .272-.092.48-.276.624-.184.136-.492.204-.924.204 0-.384-.064-.716-.192-.996-.128-.288-.38-.432-.756-.432-.288 0-.54.08-.756.24-.208.16-.368.44-.48.84-.112.392-.168.944-.168 1.656 0 .84.132 1.468.396 1.884.264.408.7.612 1.308.612.384 0 .716-.08.996-.24.288-.168.5-.38.636-.636.152.112.228.276.228.492 0 .192-.08.38-.24.564-.152.184-.384.336-.696.456-.312.12-.708.18-1.188.18Z" fill="#C13CFF"/>';

const DESC_5 =
  '<path d="M20.42 18.5v-.54h.252c.248 0 .456-.048.624-.144.176-.096.264-.328.264-.696v-5.808c0-.368-.088-.6-.264-.696a1.241 1.241 0 0 0-.624-.144h-.252v-.54h3.672v.54h-.252c-.24 0-.448.048-.624.144-.168.088-.252.304-.252.648v6.6h2.328c.336 0 .58-.108.732-.324.16-.216.26-.464.3-.744l.144-.9h.636L27.02 18.5h-6.6Zm10.666.12c-.912 0-1.62-.288-2.124-.864-.496-.576-.744-1.384-.744-2.424 0-1.128.236-1.976.708-2.544.48-.568 1.16-.852 2.04-.852.8 0 1.428.244 1.884.732.464.48.696 1.196.696 2.148v.564h-3.972c.016.856.168 1.48.456 1.872.296.384.72.576 1.272.576.416 0 .768-.088 1.056-.264.296-.176.516-.38.66-.612.064.032.12.088.168.168a.49.49 0 0 1 .084.288c0 .176-.08.36-.24.552-.152.184-.392.34-.72.468-.32.128-.728.192-1.224.192Zm1.08-3.924c0-.624-.092-1.124-.276-1.5-.184-.384-.496-.576-.936-.576-.416 0-.74.18-.972.54-.224.352-.352.864-.384 1.536h2.568Zm4.74 6.684c-.865 0-1.513-.152-1.945-.456-.424-.296-.636-.72-.636-1.272 0-.456.148-.804.444-1.044a2.21 2.21 0 0 1 1.092-.456 1.366 1.366 0 0 1-.492-.36c-.152-.168-.228-.384-.228-.648 0-.248.072-.46.216-.636.144-.184.36-.36.648-.528a1.64 1.64 0 0 1-.828-.696c-.2-.328-.3-.704-.3-1.128 0-.688.192-1.228.576-1.62.384-.4.968-.6 1.752-.6.288 0 .556.04.804.12.256.08.448.172.576.276.144-.16.312-.308.504-.444.2-.144.428-.216.684-.216.256 0 .444.064.564.192a.61.61 0 0 1 .192.444.7.7 0 0 1-.156.456c-.104.128-.284.192-.54.192a.497.497 0 0 0-.096-.3c-.064-.088-.168-.132-.312-.132a.924.924 0 0 0-.492.132c.144.176.264.384.36.624.096.24.144.524.144.852 0 .6-.184 1.096-.552 1.488-.36.392-.92.588-1.68.588-.096 0-.212-.004-.348-.012a3.415 3.415 0 0 1-.3-.048 1.193 1.193 0 0 0-.372.288.637.637 0 0 0-.156.432c0 .144.048.252.144.324.096.072.28.108.552.108h1.38c.736 0 1.264.168 1.584.504.32.336.48.772.48 1.308 0 .696-.268 1.248-.804 1.656-.528.408-1.348.612-2.46.612Zm.263-5.784c.368 0 .624-.12.768-.36.152-.248.228-.62.228-1.116 0-.512-.076-.9-.228-1.164-.152-.264-.412-.396-.78-.396-.36 0-.62.136-.78.408-.152.272-.228.66-.228 1.164 0 .488.08.856.24 1.104.16.24.42.36.78.36Zm-.24 5.16c.544 0 .972-.06 1.284-.18.312-.112.532-.272.66-.48.128-.208.192-.448.192-.72 0-.336-.1-.564-.3-.684-.192-.12-.476-.18-.852-.18h-1.236c-.208 0-.408.028-.6.084a.969.969 0 0 0-.48.312c-.12.152-.18.38-.18.684 0 .344.108.624.324.84.224.216.62.324 1.188.324Zm7.223-2.136c-.912 0-1.62-.288-2.124-.864-.496-.576-.744-1.384-.744-2.424 0-1.128.236-1.976.708-2.544.48-.568 1.16-.852 2.04-.852.8 0 1.428.244 1.884.732.464.48.696 1.196.696 2.148v.564H42.64c.016.856.168 1.48.456 1.872.296.384.72.576 1.272.576.416 0 .768-.088 1.056-.264.296-.176.516-.38.66-.612.064.032.12.088.168.168a.49.49 0 0 1 .084.288c0 .176-.08.36-.24.552-.152.184-.392.34-.72.468-.32.128-.728.192-1.224.192Zm1.08-3.924c0-.624-.092-1.124-.276-1.5-.184-.384-.496-.576-.936-.576-.416 0-.74.18-.972.54-.224.352-.352.864-.384 1.536h2.568ZM47.5 18.5v-.54h.072c.273 0 .5-.048.684-.144.192-.104.288-.34.288-.708v-3.696c0-.344-.091-.564-.276-.66a1.366 1.366 0 0 0-.66-.144h-.047v-.54h2.1l.156.936h.06c.248-.448.524-.736.828-.864a2.501 2.501 0 0 1 1.032-.204c.632 0 1.123.188 1.476.564.351.368.527.96.527 1.776v2.82c0 .376.077.616.229.72.16.096.375.144.647.144h.06v.54H52.42v-4.092c0-.52-.093-.92-.276-1.2-.176-.288-.488-.432-.936-.432-.337 0-.605.092-.804.276a1.524 1.524 0 0 0-.42.708c-.08.288-.12.6-.12.936v2.472c0 .344.088.564.264.66.184.088.407.132.672.132h.047v.54H47.5Zm10.589.12c-.792 0-1.4-.264-1.824-.792-.416-.536-.624-1.38-.624-2.532 0-1.16.208-2.008.624-2.544.424-.544 1.028-.816 1.812-.816.456 0 .828.096 1.116.288.296.192.532.44.708.744h.072c-.024-.2-.044-.428-.06-.684-.008-.256-.012-.48-.012-.672v-.9c0-.344-.1-.56-.3-.648a1.513 1.513 0 0 0-.684-.144h-.096v-.54h2.4v7.752c0 .36.096.588.288.684.2.096.432.144.696.144h.084v.54h-2.112l-.192-1.044h-.06a2.34 2.34 0 0 1-.708.852c-.288.208-.664.312-1.128.312Zm.288-.804c.584 0 .984-.208 1.2-.624.216-.416.324-1.052.324-1.908 0-.816-.112-1.444-.336-1.884-.216-.44-.616-.66-1.2-.66-.496 0-.852.22-1.068.66-.208.44-.312 1.072-.312 1.896 0 .848.104 1.48.312 1.896.216.416.576.624 1.08.624Zm6.564.804c-.528 0-.972-.156-1.332-.468-.352-.32-.528-.808-.528-1.464 0-.64.224-1.112.672-1.416.448-.312 1.132-.484 2.052-.516l.984-.036v-.696c0-.288-.024-.54-.072-.756a.826.826 0 0 0-.276-.504c-.144-.128-.364-.192-.66-.192-.424 0-.7.124-.828.372s-.192.56-.192.936c-.384 0-.676-.056-.876-.168-.2-.12-.3-.32-.3-.6 0-.28.1-.504.3-.672.2-.176.468-.304.804-.384.344-.08.724-.12 1.14-.12.76 0 1.328.156 1.704.468.384.312.576.844.576 1.596v3.096c0 .336.056.564.168.684.112.12.304.18.576.18h.036v.54H67.1l-.204-.972h-.108a7.615 7.615 0 0 1-.492.576 1.9 1.9 0 0 1-.552.384c-.208.088-.476.132-.804.132Zm.384-.78c.448 0 .804-.148 1.068-.444.264-.296.396-.692.396-1.188v-.948l-.708.036c-.616.024-1.044.16-1.284.408-.24.24-.36.588-.36 1.044 0 .728.296 1.092.888 1.092Zm4.395.66v-.54h.036c.272 0 .5-.048.684-.144.192-.104.288-.344.288-.72v-3.672c0-.352-.092-.576-.276-.672a1.438 1.438 0 0 0-.672-.144h-.036v-.54h2.004l.228 1.116h.06c.104-.24.216-.452.336-.636a1.31 1.31 0 0 1 .492-.444c.208-.112.484-.168.828-.168.448 0 .78.08.996.24.216.16.324.384.324.672 0 .28-.1.508-.3.684-.192.168-.5.252-.924.252 0-.328-.048-.568-.144-.72-.088-.16-.248-.24-.48-.24a.695.695 0 0 0-.552.252 1.78 1.78 0 0 0-.336.636c-.08.256-.14.52-.18.792a6.248 6.248 0 0 0-.048.72v1.932c0 .352.092.576.276.672.192.088.416.132.672.132h.348v.54H69.72Zm5.896 2.28c.544 0 .988-.1 1.332-.3.352-.2.632-.472.84-.816.216-.344.388-.74.516-1.188l-2.208-5.244c-.104-.24-.216-.4-.336-.48-.112-.08-.276-.12-.492-.12h-.036v-.564h3.024v.54h-.036c-.48 0-.72.18-.72.54 0 .128.036.28.108.456l.864 2.148c.112.28.216.572.312.876.096.304.16.548.192.732.048-.208.112-.432.192-.672.088-.24.164-.456.228-.648l.804-2.34c.072-.192.108-.368.108-.528 0-.376-.268-.564-.804-.564h-.036v-.54h2.556v.54h-.036c-.232 0-.412.064-.54.192-.12.12-.244.364-.372.732l-1.824 5.004c-.208.584-.408 1.06-.6 1.428-.192.368-.408.656-.648.864-.24.208-.54.352-.9.432-.352.08-.804.12-1.356.12h-.132v-.6Z" fill="#F8B73E"/>';

const DESC_6 =
  '<path d="M20.42 18.5v-.54h.252c.24 0 .448-.044.624-.132.176-.088.264-.304.264-.648v-5.916c0-.344-.088-.56-.264-.648a1.284 1.284 0 0 0-.624-.144h-.252v-.54h2.94l2.34 6.564 2.316-6.564h2.868v.54h-.252c-.248 0-.46.048-.636.144-.168.096-.252.328-.252.696v5.808c0 .368.084.6.252.696.176.096.388.144.636.144h.252v.54h-3.372v-.54h.06c.256 0 .456-.04.6-.12.144-.088.22-.292.228-.612v-6.312L25.748 18.5h-.696l-2.712-7.572v6.192c0 .368.076.6.228.696.152.096.364.144.636.144h.048v.54H20.42Zm11.309 2.28c.544 0 .988-.1 1.332-.3.352-.2.632-.472.84-.816.216-.344.388-.74.516-1.188l-2.208-5.244c-.104-.24-.216-.4-.336-.48-.112-.08-.276-.12-.492-.12h-.036v-.564h3.024v.54h-.036c-.48 0-.72.18-.72.54 0 .128.036.28.108.456l.864 2.148c.112.28.216.572.312.876.096.304.16.548.192.732.048-.208.112-.432.192-.672.088-.24.164-.456.228-.648l.804-2.34c.072-.192.108-.368.108-.528 0-.376-.268-.564-.804-.564h-.036v-.54h2.556v.54H38.1c-.232 0-.412.064-.54.192-.12.12-.244.364-.372.732l-1.824 5.004c-.208.584-.408 1.06-.6 1.428-.192.368-.408.656-.648.864-.24.208-.54.352-.9.432-.352.08-.804.12-1.356.12h-.132v-.6Zm9.304-2.16c-.592 0-1.032-.136-1.32-.408-.288-.28-.432-.768-.432-1.464v-3.96h-.9v-.516c.168 0 .344-.036.528-.108.184-.072.34-.176.468-.312.248-.256.432-.676.552-1.26h.672v1.476h1.56v.72H40.6v3.96c0 .392.076.68.228.864.16.184.38.276.66.276.144 0 .28-.008.408-.024.128-.016.252-.036.372-.06v.6a2.53 2.53 0 0 1-.504.144 3.606 3.606 0 0 1-.732.072Zm1.742-.12v-.54h.072c.272 0 .5-.048.684-.144.192-.104.288-.34.288-.708v-6.396c0-.232-.048-.404-.144-.516a.592.592 0 0 0-.348-.216 1.696 1.696 0 0 0-.456-.06h-.108v-.54h2.376v2.46c0 .16-.008.332-.024.516a27.38 27.38 0 0 1-.036.636h.072c.192-.384.436-.656.732-.816.296-.16.644-.24 1.044-.24.672 0 1.188.188 1.548.564.36.368.54.96.54 1.776v2.82c0 .376.08.616.24.72.168.096.384.144.648.144h.036v.54h-2.244v-4.092c0-.52-.092-.92-.276-1.2-.176-.288-.492-.432-.948-.432-.464 0-.804.18-1.02.54-.208.36-.312.82-.312 1.38v2.472c0 .344.092.564.276.66.184.088.408.132.672.132h.036v.54h-3.348Zm9.462-7.596a.882.882 0 0 1-.564-.18c-.144-.12-.215-.32-.215-.6 0-.288.072-.488.215-.6.152-.12.34-.18.564-.18.209 0 .389.06.54.18.16.112.24.312.24.6 0 .28-.08.48-.24.6a.845.845 0 0 1-.54.18ZM50.522 18.5v-.54h.156c.16 0 .312-.016.456-.048a.652.652 0 0 0 .347-.228c.096-.112.145-.284.145-.516V13.4c0-.232-.048-.404-.145-.516a.592.592 0 0 0-.348-.216 1.696 1.696 0 0 0-.456-.06h-.06v-.54h2.329v5.052c0 .248.044.432.132.552a.716.716 0 0 0 .36.228c.143.04.295.06.456.06h.156v.54h-3.528Zm7.129.12c-.544 0-1.028-.108-1.452-.324-.416-.224-.744-.576-.984-1.056-.24-.488-.36-1.128-.36-1.92 0-.864.12-1.54.36-2.028s.568-.836.984-1.044a3.096 3.096 0 0 1 1.404-.312c.384 0 .74.048 1.068.144.328.096.592.236.792.42.2.184.3.408.3.672 0 .272-.092.48-.276.624-.184.136-.492.204-.924.204 0-.384-.064-.716-.192-.996-.128-.288-.38-.432-.756-.432-.288 0-.54.08-.756.24-.208.16-.368.44-.48.84-.112.392-.168.944-.168 1.656 0 .84.132 1.468.396 1.884.264.408.7.612 1.308.612.384 0 .716-.08.996-.24.288-.168.5-.38.636-.636.152.112.228.276.228.492 0 .192-.08.38-.24.564-.152.184-.384.336-.696.456-.312.12-.708.18-1.188.18Z" fill="#FF44B7"/>';

const LOOT_PATH =
  "M75.42 18.5v-.54h.252c.248 0 .456-.048.624-.144.176-.096.264-.328.264-.696v-5.808c0-.368-.088-.6-.264-.696a1.241 1.241 0 0 0-.624-.144h-.252v-.54h3.672v.54h-.252c-.24 0-.448.048-.624.144-.168.088-.252.304-.252.648v6.6h2.328c.336 0 .58-.108.732-.324.16-.216.26-.464.3-.744l.144-.9h.636L82.02 18.5h-6.6Zm10.666.12c-.888 0-1.588-.276-2.1-.828-.512-.552-.768-1.392-.768-2.52 0-1.128.244-1.964.732-2.508.488-.552 1.212-.828 2.172-.828.888 0 1.588.276 2.1.828.512.544.768 1.38.768 2.508 0 1.128-.248 1.968-.744 2.52-.488.552-1.208.828-2.16.828Zm.024-.66c.56 0 .952-.228 1.176-.684.232-.456.348-1.124.348-2.004 0-.888-.116-1.552-.348-1.992-.232-.448-.628-.672-1.188-.672-.56 0-.956.224-1.188.672-.224.44-.336 1.104-.336 1.992 0 .88.116 1.548.348 2.004.232.456.628.684 1.188.684Zm7.019.66c-.888 0-1.588-.276-2.1-.828-.512-.552-.768-1.392-.768-2.52 0-1.128.244-1.964.732-2.508.488-.552 1.212-.828 2.172-.828.888 0 1.588.276 2.1.828.512.544.768 1.38.768 2.508 0 1.128-.248 1.968-.744 2.52-.488.552-1.208.828-2.16.828Zm.024-.66c.56 0 .952-.228 1.176-.684.232-.456.348-1.124.348-2.004 0-.888-.116-1.552-.348-1.992-.232-.448-.628-.672-1.188-.672-.56 0-.956.224-1.188.672-.224.44-.336 1.104-.336 1.992 0 .88.116 1.548.348 2.004.232.456.628.684 1.188.684Zm6.407.66c-.592 0-1.032-.136-1.32-.408-.288-.28-.432-.768-.432-1.464v-3.96h-.9v-.516c.168 0 .344-.036.528-.108.184-.072.34-.176.468-.312.248-.256.432-.676.552-1.26h.672v1.476h1.56v.72h-1.56v3.96c0 .392.076.68.228.864.16.184.38.276.66.276.144 0 .28-.008.408-.024.128-.016.252-.036.372-.06v.6a2.53 2.53 0 0 1-.504.144 3.606 3.606 0 0 1-.732.072Z";

const DIAMOND_PATH =
  "M10.6666 18.6348C10.6585 18.3729 10.4967 17.3916 8.73105 15.7675C7.03177 14.2045 6.23844 14.0166 6 14.0003C6.23844 13.9838 7.03177 13.796 8.73105 12.2331C10.4967 10.6089 10.6585 9.62746 10.6666 9.3658C10.6747 9.62746 10.8366 10.6089 12.6021 12.2331C14.3016 13.796 15.0948 13.9838 15.3333 14.0003C15.0949 14.0166 14.3016 14.2045 12.6021 15.7675C10.8367 17.3916 10.6748 18.3729 10.6666 18.6348Z";
